class Solution {
public:
    vector<int> evenOddBit(int n)
    {
        int even = 0, odd = 0;
        while (n > 0)
        {
            int x = __lg(n & -n);
            if (x & 1) odd++;
            else even++;
            n &= n - 1;
        }
        return { even, odd };
    }
};